From: | Tony Rolfe |
Date: | 12 Aug 99 at 01:59:01 |
Subject: | Re: Indirect Gosub |
On Sat, 25 Nov 1995 17:22:07 +0500 Roger Beausoleil said:
> Hi Tony,
>
> You should write something like this following with the help of the Asm
> to Use the Indirect Gosub:
>
> WbToScreen 0
> Window 0,0,0,320,200,$140F,"",1,0
>
> SubCallRoutine.l = ?Routine_1
>
> Main:
> Movem.l D0-D7/A0-A6,-(a7)
> GetReg A0, SubCallRoutine
> JSR (A0)
> Movem.l (A7)+, D0-D7/A0-A6
>
> if SubCallRoutine <> 0
> Bra Main
> Endif
>
> Mousewait
> end
Yes, Roger that worked perfectly.
Two things I don't understand
1. In this text you saved and restored registers, but in the example
you did not. The example code works fine (as far as I can tell).
Is it really OK to not save the registers?
2. The Blitz reference manual says the you should only use GetReg
with data registers. Is this another case of the manual getting it
wrong or is a0 a special case?
Thanks again for your help
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie